﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeTemplate.DbHelper.CoreObj
{
    /**
        field : 'id',
		title : '编号',
		width : $(this).width() * 0.1,
		sortable:true,
		align : 'center'
     **/
    public class ObjJsField
    {
        public ObjJsField() { }

        private bool isPk = false;
        private bool isUse;//是否显示，true\false
        private string field;//className
        private string type;//text
        private string title;//手工指定
        private int width;//100
        private bool sortable;//排序，true\false
        private string align;//center\left\right
        private string javaField;//className


        #region 内部属性

        public bool IsPk
        {
            get { return isPk; }
            set { isPk = value; }
        }
        public string JavaField
        {
            get { return javaField; }
            set { javaField = value; }
        }

        public bool IsUse
        {
            get { return isUse; }
            set { isUse = value; }
        }

        public string Field
        {
            get { return field; }
            set { field = value; }
        }
        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        public string Title
        {
            get { return title; }
            set { title = value; }
        }

        public int Width
        {
            get { return width; }
            set { width = value; }
        }
        public bool Sortable
        {
            get { return sortable; }
            set { sortable = value; }
        }

        public string Align
        {
            get { return align; }
            set { align = value; }
        }
        #endregion

        #region 扩展
        public string IsUseS
        {
            get
            {
                if (isUse)
                    return "true";
                else
                    return "false";
            }
        }
        public string SortableS
        {
            get {
                if (sortable)
                    return "true";
                else
                    return "false";
            }
        }

        public string HiddenS
        {
            get {
                if (isUse)
                    return "false";
                else
                    return "true";
            }
        }
        #endregion
    }
}
